package com.atwulidun.strategy21;

public class StrategyDemo {
    public static void main(String[] args) {
        // 野鸭
        Duck wildDuck = new WildDuck();
        wildDuck.display();
        // 动态改变鸭子行为：将野鸭行为改为飞得低
        wildDuck.setFly(new LowFly());
        wildDuck.display();

        // 北京鸭
        Duck pekingDuck = new PekingDuck();
        pekingDuck.display();

        // 玩具鸭
        Duck toyDuck = new ToyDuck();
        toyDuck.display();
    }
}
